import { WatcherTyp, DepTyp } from './types'
export default class Deps implements DepTyp{
    deps: WatcherTyp[]
    static target:(null | WatcherTyp) = null
    constructor() {
        this.deps = []
    }
    addWatcher(dep: WatcherTyp) {
        this.deps.push(dep)
    }
    notify() {
        this.deps.forEach(dep => {
            dep.update && dep.update()
        })
    }
}